#!/usr/bin/env python
#coding=utf-8


import urllib,urllib2
import httplib
import string

#import dbcon
import re
import StringIO
import gzip

#name = '三星'

import httplib, urllib

 

strdata = "/ref=sr_pg_2?rh=n%3A664978051%2Cn%3A665002051&page=2&bbn=664978051&ie=UTF8&qid=1336484590"

def Rhea_Amazon_create_page_url():
    i = strdata.find('?')
    urlstart = strdata[0:i-1]
    
    j = strdata[i:].find('page=')
    
    k = j+i+len('page=')
    
    urlmid = strdata[i:k]
    urlend = strdata[k+1:]
    
    print strdata
    for n in range(15):
        print urlstart + str(n) +urlmid + str(n) + urlend
    
    #j = i[1].split('page=')
    #print j

Rhea_Amazon_create_page_url()
    
